function changeLink()
{
var radios = document.getElementsByName('genderS');

for (var i = 0, length = radios.length; i < length; i++) {
    if (radios[i].checked) {
        // do whatever you want with the checked radio
if(i==0)
{
document.getElementById('results').innerHTML = 'male';
}
else
{

document.getElementById('results').innerHTML = 'female';
}
        // only one radio can be logically checked, don't check the rest
        break;
    }
}
}  



function totallyAwesome() {
  // do something TOTALLY awesome!
}

function awesomeTask() {
  changeLink();
  totallyAwesome();
}

function clickHandler(e) {
  setTimeout(awesomeTask, 1000);
}

function main() {
  // Initialization work goes here.
}

// Add event listeners once the DOM has fully loaded by listening for the
// `DOMContentLoaded` event on the document, and adding your listeners to
// specific elements when it triggers.
document.addEventListener('DOMContentLoaded', function () {
  document.querySelector('button').addEventListener('click', clickHandler);
  main();
});